function [T_order, T] = dynamic_g1_tt(y, x, params, steady_state, T_order, T)
if T_order >= 1
    return
end
[T_order, T] = M30ra.sparse.dynamic_resid_tt(y, x, params, steady_state, T_order, T);
T_order = 1;
if size(T, 1) < 38
    T = [T; NaN(38 - size(T, 1), 1)];
end
T(17) = (params(4)-1)*params(8)*1/y(15);
T(18) = (params(4)-1)*1/y(15);
T(19) = 1/y(13);
T(20) = getPowerDeriv(y(12),1-y(20),1);
T(21) = 1/y(12);
T(22) = (log(y(12))*T(20)+T(2)*T(21))/(y(20)-1)+T(20)/T(3);
T(23) = getPowerDeriv(y(12),(-y(20)),1);
T(24) = getPowerDeriv(y(22),1-y(30),1);
T(25) = 1/y(22);
T(26) = params(4)*params(8)*params(1)*((log(y(22))*T(24)+T(7)*T(25))/(y(30)-1)+T(24)/T(8));
T(27) = params(1)*getPowerDeriv(y(22),(-y(30)),1);
T(28) = getPowerDeriv(y(3),params(4),1);
T(29) = params(4)*getPowerDeriv(y(3),params(4)-1,1);
T(30) = (-y(21))/(y(13)*y(13));
T(31) = (params(4)-1)*params(8)*(-y(11))/(y(15)*y(15));
T(32) = (params(4)-1)*(-y(11))/(y(15)*y(15));
T(33) = getPowerDeriv(y(15),1-params(4),1);
T(34) = getPowerDeriv(y(15),(-params(4)),1);
T(35) = (-log(y(12)));
T(36) = ((y(20)-1)*log(y(12))*T(2)*T(35)-T(2)*log(y(12)))/((y(20)-1)*(y(20)-1))+(T(3)*T(2)*T(35)-(T(2)-1)*2*(y(20)-1))/(T(3)*T(3));
T(37) = (-log(y(22)));
T(38) = params(4)*params(8)*params(1)*(((y(30)-1)*log(y(22))*T(7)*T(37)-T(7)*log(y(22)))/((y(30)-1)*(y(30)-1))+(T(8)*T(7)*T(37)-(T(7)-1)*2*(y(30)-1))/(T(8)*T(8)));
end
